package object2;

/**
 *
 */
public class EqualsExercise02 {

    public static void main(String[] args) {

        Person_ p1 = new Person_();
        p1.name = "lmy";

        Person_ p2 = new Person_();
        p2.name = "lmy";

        System.out.println(p1 == p2);//false
        System.out.println(p1.name.equals(p2.name));//true
        System.out.println(p1.equals(p2));//false

        String s1 = new String("lmy");
        String s2 = new String("lmy");
        System.out.println(s1.equals(s2));//true
        System.out.println(s1 == s2);//false

    }
}

class Person_ {

    public String name;
}
